<template>

	<view>
		<view v-if="isLoading" style="width: 100%;height: calc(100vh);position: absolute;z-index: 10000;">
			<image src="../../../static/icon/loading.png" style="width: 110rpx;height: 110rpx;" class="loading" mode=""></image>
		</view>
		<view @click="close1()" v-if="isShow" style="width: 100%;height: calc(100vh);position: absolute;z-index: 98;"></view>
		<view class="TC" style="position: relative; z-index: 999;" v-if="isShow">
			<view class="box">

				<view class="box1">
					<view class="box1-a">
						<view style="font-size: 40rpx;
		color: #a485ed;">
							提示
						</view>
						<view style="font-size: 40rpx;
		color: #a485ed;">
							{{msg}}
							<!-- 图片代替 -->
							<!-- <image 
								src="../../../static/icon/视频.jpg" alt=""> -->
							<!-- 视频 -->

						</view>

						<view class="btnA">
							<button type="button" style="color: #FFFFFF; " @click="close1()">确认</button>
						</view>
					</view>

				</view>
			</view>
		</view>

		<view class="mack-a" :style=" 'filter: blur('+this.$store.state.mackNum2+'px);'">
			<NavBar></NavBar>
			<view class="title">
				<view class="til">
					<view>点击挂售时</view>
					<view>没绑定手机需要绑定手机</view>
				</view>
			</view>

			<view class="box">

				<view class="box1">
					<view class="box1-a">



						<view>
							<form>
								<view class="username">
									<image src="../../../static/icon/regi_icon/iconfont-phone.png" mode=""></image>
									<text>手&nbsp;机:</text>
									<input v-model="dataFrom.mobile" @input="iponeinput" placeholder="请输入手机号" type="number" style="text-indent: 48rpx; width: 316rpx;
						height: 84rpx;
						margin-left: 22rpx;
						border-radius: 10rpx;
						box-shadow: inset 0px 2px 5px #9e9e9e80;" />
								</view>
								<view class="password">
									<view style="margin-left: -24rpx;display: flex;
    align-items: center;">
										<image style="width: 36rpx;height: 36rpx;" src="../../../static/icon/yzm.png"
											mode=""></image>
										<text>验证码:</text>
									</view>
									<input v-model="dataFrom.verify_code" placeholder="输入" type="number" style="text-indent: 48rpx;  width: 316rpx;
						height: 84rpx;
						margin-left: 22rpx;
						border-radius: 10rpx;
						box-shadow: inset 0px 2px 5px #9e9e9e80;" />
									<view>
										<button style=" padding-left: 4px;
    padding-right: 4px;
    color: rgb(250,248,255);
    background-color: rgb(164, 113, 251);
    position: absolute;
    width: 34%;
    height: 42px;
    right: 0%;
    bottom: 0px;
    text-align: center;
    line-height: 42px;
    font-size: 13px;" @click="send()">发送</button>
									</view>
								</view>
							</form>

							<view class="btnA">
								<button type="button" style="color: #FFFFFF; " @click="Bending()">确认绑定</button>
							</view>
						</view>
						<!-- 	<view class="btnB">
						<button type="button" @click="goNavto">注册</button>
					</view> -->
					</view>
					<view class="box2-a">
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapMutations,mapState
	} from 'vuex'
	import uniRequest from '@/until/uni-request.js'
	import NavBar from '@/components/registerNav.vue'
	export default {
		computed: {//加载数据过程loading
			    ...mapState(["isLoading"])
			},
		components: {
			NavBar
		},
		data() {
			return {
				isShow: false,
				msg: '',
				barStyle: {},
				current: 0,
				list: [{
						name: '账号登录'
					},
					{
						name: '手机登录'
					},
					{
						name: '短信登录'
					},

				],
				dataFrom: {
					mobile: '',
					verify_code: ""
				},
				username: "username",
				password: "password",
				passwordIcon: true,
				issend:false,
				border: true
			}
		},
		onShow() {
			this.close1()
		},
		onHide() {
			// this.closemackNum()
		},
		methods: {
			iponeinput(){
				
				var strTemp = /^1[3|4|5|6|7|8|9][0-9]{9}$/;
				if(strTemp.test(this.dataFrom.mobile)){
					// uni.showToast({icon:'none',title:'电话格式正确'});
					this.issend=true
					return
				}else{
					uni.showToast({icon:'none',title:'请输入正确的电话'});
					this.issend=false
					return false
				}
			},
			close1() {
				this.isShow = false
				this.closeTCxun()
			},
			...mapMutations(['openTCxun','closemackNum', 'closeTCxun']),
			send() {
			if(!this.issend){
				uni.showToast({icon:'none',title:'请输入正确的电话'});
			}else{
				uniRequest.post('base/sms/send', {
					"mobile": this.dataFrom.mobile,
					"template": "bindmobile"
				}).then((res) => {
					console.log(res);
					if (res.data.code == "1001") {
						this.msg = res.data.msg
						this.isShow = true
						this.openTCxun()
					}
					this.msg = res.data.msg
					this.isShow = true
				}).catch((err) => {
					console.log(err);
				});
			}
			},
			Bending() {
				uniRequest.post('user/user/bindmobile', this.dataFrom).then((res) => {
					console.log(res);
					if (res.data.code == "1001") {
						this.msg = res.data.msg
						this.isShow = true
						this.openTCxun()
					}
					this.msg = res.data.msg
					this.isShow = true
				}).catch((err) => {
					console.log(err);
				});
			},
			sectionChange(index) {
				this.current = index;
				console.log(this.current);

			},
			change(e) {
				console.log('change', e);
			},
			goNavto() {
				uni.navigateTo({
					url: "/pages/LoginRegistration/register/register"
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@-webkit-keyframes tdtc {
		0% {
			transform: scale(0.8); 
			// transform: scale(0.8);  
			opacity: 0.5;  
		}
	// 50% {
	// 	transform: scale(1);  
	// 	// opacity: 0.5;  
	// }
	45%{
		transform: scale(1);
		opacity: 1; 
	}
		// 90% {
		// 	transform: scale(1);
		// 	opacity: 1; 
		// }
		100% {
			transform: scale(1);
			opacity: 1; 
		}
	}
	.TC {
		animation-name:tdtc;
		animation-duration:0.9s;
		transform-origin:350rpx 500rpx;
		animation-timing-function:cubic-bezier(0.01, 1.24, 0.08, 1.36);
		animation-iteration-count:1;
		animation-play-state: running;
		.toptext {
			position: absolute;
			// top: -8%;
			top: 100rpx;
			left: 35%;
			z-index: 999;
			background-color: #fff;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
	
			.text-a {
	
				font-size: 46rpx;
			}
	
			.text-b {
				color: rgb(148, 113, 254);
				font-size: 32rpx;
			}
		}
	
		height: 100%;
		background-color: rgb(255, 255, 255);
	
		// background: linear-gradient(#7a52c0, #d7d7d7) no-repeat;
		.title {
			text-align: center;
			line-height: 100rpx;
			font-size: 60rpx;
			color: rgb(164, 133, 237);
		}
	
		.box {
			z-index: 99;
			background-color: #fff;
	
			.box1 {
	
				// margin-top: 20rpx;
				.box1-a {
					width: 100%;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					height: 300px;
					align-items: center;
	
					image {
						width: 552rpx;
						height: 319rpx;
					}
				}
			}
	
			.send {
				position: absolute;
				right: 52rpx;
	
				uni-button {
					border-radius: 100rpx;
					height: 92rpx;
					line-height: 92rpx;
					color: #fff;
					width: 144rpx;
					background: rgb(121, 72, 234);
					font-size: 28rpx;
				}
			}
	
			.box2-a {
				width: 94%;
				height: 16px;
				background-color: #fffefe7d;
				box-shadow: 0px 5px 50px #9e9e9e3b;
				border-radius: 0rem 0rem 10px 10px;
				/* opacity: 0.4; */
				position: absolute;
				left: 3%;
				bottom: -16px;
				// /* z-index: -1;
			}
	
			.u-input--border[data-v-fdbb9fe6] {
				border-radius: 100rpx;
				height: 96rpx;
				box-sizing: border-box;
				padding-top: 8rpx !important;
				margin-left: 10rpx;
			}
	
			.username {
				font-size: 18px;
				display: flex;
				align-items: center;
	
				image {
					width: 16px;
					height: 16px;
					margin-right: 4px;
				}
			}
	
			.password {
				font-size: 18px;
				display: flex;
				align-items: center;
				margin-top: 30px;
	
				image {
					width: 16px;
					margin-right: 4px;
					height: 16px;
				}
			}
	
			.sms {
				display: flex;
				justify-content: end;
				color: rgb(164, 133, 237);
				padding: 10% 0;
				padding-bottom: 12%;
				margin-right: 36rpx;
			}
	
			z-index: 99;
			background-color: #fff;
			box-sizing: border-box;
			padding: 48rpx;
			box-shadow: 0px 10rpx 100rpx #9e9e9e80;
			position: absolute;
			background: #fff;
			width: 80%;
			    height: 764rpx;
			border-radius: 2%;
			top: 228rpx;
			left: 10%;
	
			.btnA {
	
				width: 67%;
				margin: 0px auto;
				// margin-top: 40%;
	
				uni-button {
					border-radius: 64rpx;
					background: linear-gradient(to right, #A272FC, #DE62D2);
				}
			}
	
			.btnB {
				width: 60%;
	
				uni-button {
					margin-top: 20rpx;
					border-radius: 32px;
					color: #7a52c0;
				}
	
				margin: 0px auto;
			}
		}
	}
	
	.uni-input-placeholder {
		color: rgb(189, 189, 189);
		font-size: 28rpx;
	}

	::v-deep .u-sticky {
		height: 100rpx;
		// width:	100%;
		// display: flex;
		// justify-content: center;
		// align-items: center;
	}

	::v-deep .u-tabs__wrapper__nav__item {
		padding: 0 32rpx;
		// width: 200rpx;
	}

	uni-page-body {
		height: 100%;
		background-color: rgb(255, 255, 255);

		// background: linear-gradient(#7a52c0, #d7d7d7) no-repeat;
		.title {
			text-align: center;
			color: rgb(251, 127, 243);
			font-size: 44rpx;
			margin-top: 20rpx;

			.til {}



		}

		.box {
			.box1 {
				.box1-a {
					form {
						display: flex;
						justify-content: center;
						margin-top: 76rpx;
					}
				}
			}

			.box2-a {
				width: 94%;
				height: 16px;
				background-color: #fffefe7d;
				box-shadow: 0px 5px 50px #9e9e9e3b;
				border-radius: 0rem 0rem 10px 10px;
				/* opacity: 0.4; */
				position: absolute;
				left: 3%;
				bottom: -16px;
				// /* z-index: -1;
			}

			.u-input--border[data-v-fdbb9fe6] {
				border-radius: 100rpx;
				height: 96rpx;
				box-sizing: border-box;
				padding-top: 8rpx !important;
				margin-left: 10rpx;
			}

			.username {
				color: rgb(148, 113, 254);
				font-size: 18px;
				display: flex;
				align-items: center;

				image {
					width: 16px;
					height: 16px;
					margin-right: 4px;
				}
			}

			.password {
				color: rgb(148, 113, 254);
				font-size: 18px;
				display: flex;
				align-items: center;
				margin-top: 30px;
				position: relative;

				image {
					width: 16px;
					margin-right: 4px;
					height: 16px;
				}
			}

			.sms {
				display: flex;
				justify-content: end;
				color: rgb(121, 72, 234);
				padding: 5% 0;
				padding-bottom: 12%;
				margin-right: 56rpx;
				font-size: 32rpx;
			}

			box-sizing: border-box;
			padding: 48rpx 20rpx;
			// padding-top: 90rpx;
			box-shadow: 0px 5px 50px #9e9e9e80;

			position: absolute;
			background: #fff;
			width: 81%;
			height: 928rpx;
			border-radius: 5%;
			top: 264rpx;
			left: 9%;

			.btnA {

				width: 65%;
				margin: 0px auto;
				margin-top: 63%;

				uni-button {
					border-radius: 64rpx;
					background: linear-gradient(to right, #A272FC, #DE62D2);
				}
			}

			.btnB {
				width: 53%;

				uni-button {
					margin-top: 20rpx;
					border-radius: 32px;
					color: #7a52c0;
				}

				margin: 0px auto;
			}
		}
	}
</style>
